<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //打印等腰三角形
var m=+prompt("打印m行等腰三角形");
for(var i=1;i<=m;i++){
    //打印空格数
    for(var j=1;j<=m-i;j++){
        document.write(`<span style="display: inline-block;width: 20px;text-align: center;"></span>`);
    }
    //打印*
    for(var k=1;k<=i*2-1;k++){
        document.write(`<span style="display: inline-block;width: 20px;text-align: center;">*</span>`);
    }
    document.write(`<br/>`)
}
    </script>
    <script>
        //打印平行四边形
var m = prompt("请输入高:");
var n = prompt("请输入长:");
//判断是否符合条件
if (m < 2 || n < 2) {
    alert("长和高任意一个都不能小于2,请重新输入");
} else {
    for (var i = 0; i < m; i++) {
        //打印m - i个空格
        for (var j = 0; j < m - i; j++) {
            document.write(`<span style="display:inline-block;width:20px;"></span>`);
        }
        //打印n个星星
        for (var k = 0; k < n; k++) {
            document.write(`<span style="display:inline-block;width:20px;">*</span>`);
        }
        document.write("<br>");
    }
}
    </script>
</body>
</html>